<?php

session_start();

ob_start();

include 'views/header.php';

if (isset($_GET['a'])) {
	include 'controllers/UserController.php';
	include 'controllers/ArticleController.php';
	$c = new UserController();
	$a = new ArticleController();
	switch($_GET['a']) {
		case 'inscription' : $c->inscription(); break;
		case 'connexion' : $c->connexion(); break;
		case 'deconnexion' : $c->deconnexion(); break;
		case 'liste' : $c->liste(); break;
		case 'maj' : $c->maj(); break;
		case 'vendre' : $a->vendre(); break;
		case 'rechercher' : $a->rechercher(); break;
	}
} else {
	include 'views/home.php';
}

include 'views/footer.php';

$content = ob_get_clean();

echo $content;

?>
